<template>
	<view class="lz-padding-top-30 lz-padding-bottom-30">
		<view class="content" v-for="(item,index) in list" :key="index" v-if="list.length>0" @click="todetail(item)">
			<view class="img">
				<u--image :showLoading="true" :src="item.imgUrl" width="100" mode="aspectFill" radius="10"></u--image>
			</view>
			<view class="desc">
				<view class="text-title">{{item.fictionName}}</view>
				<view class="text-content">作者：{{item.author}}</view>
				<view class="text-content">{{item.newest}}</view>
				<view class="time lz-margin-top-10">
					<u-tag :text="item.state" size="mini"></u-tag>
					<u-tag :text="item.type" size="mini" type="error" class="lz-margin-left-10"></u-tag>
				</view>
			</view>
		</view>
		<view v-if="list.length==0" style="padding-top:30%">
			<u-empty mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'artList',
		props: {
			list: {
				//列表
				type: Array,
				default: () => []
			},
			tiemFlag: {
				//是否显示日期时间
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				todetail(item) {
					this.$emit("viewDetail", item)
				}
			};
		},
		methods: {

		}
	};
</script>

<style scoped lang="scss">
	.content {
		background: #ffffff;
		margin: 0 26rpx 26rpx;
		padding: 20rpx 28rpx;
		border-radius: 10rpx;
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		align-items: center;
		box-shadow: 2px 2px 5px 2px rgba(0, 0, 0, 0.2);
	}

	.img {
		display: block;
		width: 210rpx;
		height: 300rpx;
		overflow: hidden;
		margin-right: 20rpx;

	}

	.img ::v-deep .u-image {
		width: 210rpx !important;
		height: 300rpx !important;
	}

	.img ::v-deep .u-image__error {
		width: 210rpx !important;
		height: 300rpx !important;
	}

	.img image {
		width: 100%;
		height: 100%;
	}

	.desc {
		display: block;
		width: 426rpx;

		.text-title {
			color: #333333;
			font-family: 思源黑体;
			font-size: 30rpx;
			line-height: 1.8;
			font-weight: 500;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			/* 显示省略号 */
		}

		.text-content {
			color: #888888;
			font-family: 思源黑体;
			font-size: 28rpx;
			line-height: 1.4;
			font-weight: 400;
			text-align: justify;
			display: -webkit-box;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
			overflow: hidden;
			text-overflow: ellipsis;
		}

		.time {
			color: #aaa;
			font-family: 思源黑体;
			font-size: 26rpx;
			line-height: 1.5;
			font-weight: 400;
			display: flex;
			flex-direction: row;
			align-items: center;
		}
	}
</style>